<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form id="Form1" name="Form1" action="${pageContext.request.contextPath}/FindOrderByIdServlet" method="post">
    <table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
        <tr>
            <td align="center" bgColor="#afd1f3"><strong>查 询 条 件</strong></td>
        </tr>
        <tr>
            <td>
                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                    <tr>
                        <td height="22" align="center" bgColor="#f5fafe">订单编号：</td>
                        <td bgColor="#ffffff"><input type="text"
                                                     name="id" size="15" value="" id="id" />
                        </td>
                        <td height="22" align="center" bgColor="#f5fafe">收件人：</td>
                        <td  bgColor="#ffffff"><input type="text"
                                                      name="name" size="15" value="" id="name" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100" height="22" align="center" bgColor="#f5fafe"></td>
                        <td bgColor="#ffffff"><font face="宋体"
                                                    color="red"> &nbsp;</font></td>
                        <td align="right" bgColor="#ffffff"><br /> <br /></td>
                        <td align="right" bgColor="#ffffff">
                            <button type="submit" id="search" name="search"
                                    value="查询">
                                查询</button> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="reset" name="reset" value="重置" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center" bgColor="#afd1f3"><strong>订 单 列 表</strong></TD>
        </tr>
        <tr>
            <td align="center" bgColor="#f5fafe">
                <table cellspacing="0" cellpadding="1" rules="all"
                       bordercolor="gray" border="1" id="DataGrid1"
                       style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
                    <tr
                            style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">
                        <td align="center" width="20%">订单编号</td>
                        <td align="center" width="10%">收件人</td>
                        <td align="center" width="16%">地址</td>
                        <td align="center" width="10%">联系电话</td>
                        <td width="10%" align="center">总价</td>
                        <td width="8%" align="center">所属用户</td>
                        <td width="10%" align="center">订单状态</td>
                        <td width="8%" align="center">查看</td>
                        <td width="8%" align="center">删除</td>
                    </tr>
                        <c:forEach items="${orders}" var="order">
                    <tr onmouseover="this.style.backgroundColor = 'white'"
                        onmouseout="this.style.backgroundColor = '#F5FAFE';">
                        <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                            width="200">
                            ${order.getId()}
                        </td>
                        <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                            width="10%">
                            ${order.getReceiverName()}
                        </td>
                        <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="16%">
                            ${order.getReceiverAddress()}
                        </td>
                        <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="10%">
                            ${order.getReceiverPhone()}
                        </td>
                        <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                            ${order.getMoney()}
                        </td>
                        <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                            ${order.getUser().getUsername()}
                        </td>
                        <td style="CURSOR: hand; HEIGHT: 22px" align="center">
                            ${order.getPayState() == 0 ? "未支付" : "已支付"}
                        </td>

                        <!-- 查看 -->
                        <td align="center" style="HEIGHT: 22px" width="7%">
                            <a href="${pageContext.request.contextPath}/FindOrderByIdServlet?id=${order.id}">
                                <img
                                    src="${pageContext.request.contextPath}/admin/images/i_edit.gif"
                                    width="16" height="16" border="0" style="CURSOR: hand">
                            </a>
                        </td>
                        <!-- 删除 -->
                        <td align="center" style="HEIGHT: 22px" width="7%">
                            <a href="${pageContext.request.contextPath}/DelOrderByIdServlet?id=${order.id}">
                                <img
                                    src="${pageContext.request.contextPath}/admin/images/i_del.gif"
                                    width="16" height="16" border="0" style="CURSOR: hand">
                            </a>
                        </td>
                    </tr>
                        </c:forEach>
                </table>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
